Do not add extra empty form in inline formsets if not needed

Ticket:	#5352