Share the utf8 to wchar conversion routine between lavf and lavu

This doesn't add any dependency on library internals, since this
only is a static inline function that gets built into each of the
calling functions - this is only to reduce the code duplication.

Signed-off-by: Martin Storsjö <martin@martin.st>
lavf: Use MoveFileEx instead of rename/_wrename on windows

This allows getting the normal unix semantics, where a rename
allows replacing an existing file.

Based on a suggestion by Reimar Döffinger.

Signed-off-by: Martin Storsjö <martin@martin.st>
Revert "lavf: Don't try to update files atomically with renames on windows"

This reverts commit b9d08c77a44390b0848c06f20bc0e9e951ba6a3c.

After taking MoveFileEx into use, we can replace files with renames
on windows as well.

Signed-off-by: Martin Storsjö <martin@martin.st>