Kangana and Javed Akhtar end legal battle after five years