module_utils/atomic_move(): Restore owner/group

Manually restore owner and group if both src and dest are on a separate
file system.
module_utils/atomic_move(): Use tempfile module

Fix a potential race condition by using the tempfile module.