Foreign demand for Japanese machinery slumps by most since 2007