btrfs-progs: move contents of math.h to utils.h and delete

Signed-off-by: David Sterba <dsterba@suse.cz>
btrfs-progs: corrupt block, add missing break to option I

Using -I would imply -d.

Resolves-Coverity-CID: 1258792
Signed-off-by: David Sterba <dsterba@suse.cz>
btrfs-progs: corrupt block, add break after option U

Resolves-Coverity-CID: 1258793
Signed-off-by: David Sterba <dsterba@suse.cz>
btrfs-progs: fragments, close output file on error

Resolves-Coverity-CID: 1258794
Signed-off-by: David Sterba <dsterba@suse.cz>
btrfs-progs: check result of first_cache_extent

If the tree's empty, we'll get NULL and dereference it.

Resolves-Coverity-CID: 1248828
Signed-off-by: David Sterba <dsterba@suse.cz>
btrfs-progs: check allocation result in add_clone_source

Resolves-Coverity-CID: 1054894
Signed-off-by: David Sterba <dsterba@suse.cz>
btrfs-progs: let btrfs_free_path accept NULL

Same in kernel and matches semantics of free().

Resolves-Coverity-CID: 1054881
Signed-off-by: David Sterba <dsterba@suse.cz>