Correct #endif placement (avoid linking error for TiledLibreOffice)

Change-Id: I37577456740b4dd255df22047ce7740bd1e43ace