Structural stability of titania thin films