The new study found anti-inflammatory drugs, such as ibuprofen, as well as antibiotics, antivirals and vaccinations, were associated with a lower risk of developing dementia