Use std::make_unique where it makes sense to

(and improve some other unique_ptr initializations).

Adapted from delroth's pull request.