flash/stm32l4x: free write_algorithm work area if no space left for the buffer