Right-handed neutrino dark matter, neutrino masses, and non-standard cosmology in a 2HDM