A new study has found prolonged use of non-steroidal anti-inflammatories could also reduce the risk of dementia.