Use temporary dir for image conversion

Image cache uses master_dir as temporary directory for images
conversion (pass tmp_path to fetch_to_raw()). This can cause
a problem because links created after conversion and
working files can be candidates for deletion.
This patch uses own temporary directory for image conversion.

Closes-bug: #1326556
Change-Id: I0ad1aeba95a177a5ea6a1d0a09ea37c5ff2b0837
Merge "Use temporary dir for image conversion"