As the author of the earlier answer notes, the critical step to protecting your data is to
Make sure the start equals the start of the partition table you printed earlier.
As long as you do that, the OS won't notice when you delete the partition, because it's using the memory-cached partition table that it set up at boot time (hence the error when writing the new partition table). When you reboot, the OS will find the data where it left it, because the new partition begins in exactly the same place the old one did. Sure, it ends a lot further on than it used to, but moving the end of a partition isn't a problem in the same way that moving the beginning is - which is to say, fatal for your data.
However, as with all such exercises, you should both take and test a full backup before doing any of this on live data.