Add support for :nsec option to Time#change

This is a follow-up of https://github.com/rails/rails/pull/16765 and is based on that branch.

Closes #16392.